package com.itheima.gen;

import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;

class StringGenerator {
    static String[] words = {"love", "happiness", "family", "friendship", "laughter", "joy", "celebration", "birth", "marriage", "children", "parents", "siblings", "grandparents", "vacation", "holiday", "travel", "adventure", "exploration", "relaxation", "rest", "leisure", "entertainment", "sports", "games", "music", "dance", "art", "culture", "food", "drink", "cooking", "eating", "dining", "shopping", "fashion", "beauty", "health", "wellness", "exercise", "fitness", "work", "career", "education", "learning", "growth", "development", "success", "achievement", "failure", "challenge"};

    static String[] names2 = {"宋江", "吴用", "关胜", "林冲", "秦明", "花荣", "柴进", "李应", "朱仝", "武松", "董平", "张清", "杨志", "徐宁", "索超", "戴宗", "刘唐", "李逵", "史进", "穆弘", "雷横", "李俊", "张横", "张顺", "杨雄", "石秀", "解珍", "解宝", "燕青", "朱武", "黄信", "孙立", "宣赞", "韩滔", "彭玘", "萧让", "裴宣", "欧鹏", "邓飞", "燕顺", "杨林", "凌振", "蒋敬", "吕方", "郭盛", "王英", "鲍旭", "樊瑞", "孔明", "孔亮", "项充", "李衮", "马麟", "童威", "童猛", "孟康", "侯健", "陈达", "杨春", "宋清", "乐和", "龚旺", "穆春", "曹正", "宋万", "杜迁", "薛永", "施恩", "李忠", "周通", "汤隆", "杜兴", "邹渊", "邹润", "朱贵", "朱富", "蔡福", "蔡庆", "李立", "李云", "焦挺", "石勇", "孙新", "张青", "白胜", "时迁"};
    static String[] names3 = {"卢俊义", "公孙胜", "呼延灼", "鲁智深", "阮小二", "阮小五", "阮小七", "郝思文", "单廷珪", "魏定国", "安道全", "皇甫端", "扈三娘", "金大坚", "郑天寿", "陶宗旺", "丁得孙", "顾大嫂", "孙二娘", "王定六", "郁保四", "段景住"};

    public static String word() {
        return words[new Random().nextInt(words.length)];
    }

    public static String name() {
        return name(-1);
    }

    public static String name(int count) {
        Random random = new Random();
        String[] names;
        switch (count) {
            case 2:
                names = names2;
            case 3:
                names = names3;
            default:
                int nameLength = random.nextInt(2) + 2; // Generate a random number between 2 and 3
                names = (nameLength == 2) ? names2 : names3;
        }

        return names[random.nextInt(names.length)];
    }

    public static void main(String[] args) {
        String name = name(-1);
        System.out.println("Generated name: " + name);
    }
}